package com.wk.springboot.spring.lifeCircle;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @User admin
 * @Date 2020/11/25 14:34
 **/

@Component
public class BeanPostProcessorLifeCircle implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
//        System.out.println("正在初始化......beanName = " + beanName);
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
//        System.out.println("初始化完成......beanName = " + beanName);
        return bean;
    }
}
